package com.hui.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hui.entity.dao.StoreOrder;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 订单表(StoreOrder)表数据库访问层
 *
 * @author hui
 * @since 2022-07-21 00:12:56
 */
public interface StoreOrderMapper extends BaseMapper<StoreOrder> {
    /**
     * 获取购买的商品总价
     *
     * @param uid
     * @return
     */
    @Select({"select IFNULL(sum(pay_price),0) from store_order where paid=1 and is_del=0 and refund_status=0 and uid=#{uid}"})
    double sumPrice(@Param("uid") Long uid);
}

